public class TestStudent {
    //实例成员变量
    //实例代码块
    private String name;
    private String gender;
    private int age;
    private double score;
    private static String classes;
    public TestStudent() {
        System.out.println("I am Student init()!");
    }
    //实例代码块
    {
        this.name = "bit";
        this.age = 12;
        System.out.println("I am instance init()!");
    }
    // 静态代码块
    static {
        classes = "bit306";
        System.out.println("I am static init()!");
    }
    { //直接使用{}定义，普通方法块
        int x = 10;
        System.out.println("x1 = " +x);
    }
    public void show(){
        System.out.println("name: "+name+" age: "+age);
    }
        public static void main(String[] args) {
            TestStudent stu = new TestStudent();
            stu.show();
        }
}
